package com.zhongjian.technologycal.mall.activity.main.activity;

import android.os.Bundle;
import android.text.TextUtils;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.zhongjian.technologycal.mall.R;
import com.zhongjian.technologycal.mall.base.BaseActivity;
import com.zhongjian.technologycal.mall.utils.Countdown;
import com.zhongjian.technologycal.mall.utils.StatusBarUtil;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by wei on 2017/12/4.
 * des 报名信息页面的处理
 */

public class RegistrationInformationActivity extends BaseActivity {
    @BindView(R.id.tv_main_title)
    TextView tv_main_title;
    @BindView(R.id.info_iv_status1)
    ImageView info_iv_status1;
    @BindView(R.id.info_iv_status2)
    ImageView info_iv_status2;
    @BindView(R.id.info_iv_status3)
    ImageView info_iv_status3;
    @BindView(R.id.info_tv_status1)
    TextView info_tv_status1;
    @BindView(R.id.info_tv_status2)
    TextView info_tv_status2;
    @BindView(R.id.info_tv_status3)
    TextView info_tv_status3;
    //课程
    @BindView(R.id.info_tv_course)
    TextView info_tv_course;
    //价格
    @BindView(R.id.info_tv_price)
    TextView info_tv_price;
    //姓名
    @BindView(R.id.info_et_realname)
    EditText info_et_realname;
    //手机号
    @BindView(R.id.info_et_telphone)
    EditText info_et_telphone;
    //验证码
    @BindView(R.id.info_et_code)
    EditText info_et_code;
    //获取验证码
    @BindView(R.id.info_tv_code)
    TextView info_tv_code;
    @BindView(R.id.info_ll_area)
    LinearLayout info_ll_area;
    //地区
    @BindView(R.id.info_tv_area)
    TextView info_tv_area;
    @BindView(R.id.info_tv_commit)
    TextView info_tv_commit;
    @Override
    protected void beforeInit() {
        super.beforeInit();
//        StatusBarUtil.setColorNoTranslucent(this, getResources().getColor(R.color.border_color));
//        StatusBarUtil.setMiuiStatusBarDarkMode(this, true);
    }

    @Override
    public void initPresenter() {

    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        tv_main_title.setText("报名信息");
    }

    @Override
    protected int getContentViewLayoutID() {
        return R.layout.activity_registration_information;
    }
    @OnClick(R.id.iv_back_page)
    public void onClickFinish(){
        finish();
    }
    @OnClick(R.id.info_tv_code)
    public void onClickCode(){
        if(TextUtils.isEmpty(info_et_telphone.getText().toString())){
            Toast.makeText(getBaseContext(),"手机号不能为空.",Toast.LENGTH_SHORT).show();
            return;
        }else if(info_et_telphone.getText().toString().length()> 10){
            new Countdown(info_tv_code, 60, "秒后重试", false);
            info_tv_code.setClickable(false);
        }else{
            new Countdown(info_tv_code, 0, "秒后重试", false);
            info_tv_code.setClickable(true);
        }


    }
    @OnClick(R.id.info_tv_commit)
    public void onClickCommit(){

    }
}
